<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-people-edit" th:object="${people}">
            <input id="peopleId" name="peopleId" th:field="*{peopleId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">姓名：</label>
				<div class="col-sm-8">
					<input id="peopleName" name="peopleName" th:field="*{peopleName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">身份证号：</label>
				<div class="col-sm-8">
					<input id="peopleIdCard" name="peopleIdCard" th:field="*{peopleIdCard}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">市（州）：</label>
				<div class="col-sm-8">
					<input id="peopleCity" name="peopleCity" th:field="*{peopleCity}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">县（市、区）：</label>
				<div class="col-sm-8">
					<input id="peopleCounty" name="peopleCounty" th:field="*{peopleCounty}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">乡镇（办、场、区：</label>
				<div class="col-sm-8">
					<input id="peopleTownship" name="peopleTownship" th:field="*{peopleTownship}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">社区（村）：</label>
				<div class="col-sm-8">
					<input id="peopleVillage" name="peopleVillage" th:field="*{peopleVillage}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">详细地址：</label>
				<div class="col-sm-8">
					<input id="peopleDetailAdress" name="peopleDetailAdress" th:field="*{peopleDetailAdress}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">手机号：</label>
				<div class="col-sm-8">
					<input id="peopleConnectPhone" name="peopleConnectPhone" th:field="*{peopleConnectPhone}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">岗位（工种）：</label>
				<div class="col-sm-8">
					<input id="peopleJob" name="peopleJob" th:field="*{peopleJob}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">驾驶人/返岗人员：</label>
				<div class="col-sm-8">
					<input id="peopleBackPeople" name="peopleBackPeople" th:field="*{peopleBackPeople}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">车辆牌照号：</label>
				<div class="col-sm-8">
					<input id="peopleCarLicense" name="peopleCarLicense" th:field="*{peopleCarLicense}" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">健康证明文件地址：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="peopleLinkAdress" name="peopleLinkAdress" th:field="*{peopleLinkAdress}" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">填报时间：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="peopleFillTime" name="peopleFillTime" th:field="*{peopleFillTime}" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">企业信息ID：</label>
				<div class="col-sm-8">
					<input id="companyId" name="companyId" th:field="*{companyId}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建者：</label>
				<div class="col-sm-8">
					<input id="createBy" name="createBy" th:field="*{createBy}" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">创建时间：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">
				<label class="col-sm-3 control-label">更新者：</label>
				<div class="col-sm-8">
					<input id="updateBy" name="updateBy" th:field="*{updateBy}" class="form-control" type="text">
				</div>
			</div>
			<!--<div class="form-group">	-->
				<!--<label class="col-sm-3 control-label">更新时间：</label>-->
				<!--<div class="col-sm-8">-->
					<!--<input id="updateTime" name="updateTime" th:field="*{updateTime}" class="form-control" type="text">-->
				<!--</div>-->
			<!--</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">请重新上传：</label>
				<div class="col-sm-8">
					<input type="file" class="btn btn-w-m btn-default" name="fileName" accept="image/png,image/jpeg,image/jp2" />
					<!--<input id="resourceRelativePath" name="resourceRelativePath" class="form-control" type="text">-->
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/people"
		$("#form-people-edit").validate({
			rules:{
                peopleConnectPhone:{
                    required:true,
                    isPhone:true,
                    remote: {
                        url: ctx + "system/user/checkPhoneUnique",
                        type: "post",
                        dataType: "json",
                        data: {
                            name: function () {
                                return $.common.trim($("#peopleConnectPhone").val());
                            }
                        },
                        dataFilter: function (data, type) {
                            return $.validate.unique(data);
                        }
                    }
                },
                peopleName:{
                    required:true,
                },
                peopleIdCard:{
                    required:true,
                    maxlength: 18
                },
			}
		});

        function upload() {
            var formData = new FormData($("#form-people-edit")[0]);
            $.modal.loading("正在上传数据，请稍后...");
            $.ajax({
                cache : true,
                type : "POST",
                url : prefix + "/change",
                data : formData,
                contentType:false,
                processData:false,
                mimeType:"multipart/form-data",
                error : function(request) {
                    $.modal.alertError("系统错误");
                },
                success : function(data) {
                    var jData = $.parseJSON(data);
                    $.operate.successCallback(jData);
                    $.modal.closeLoading();
                }
            });
        }

		function submitHandler() {
	        if ($.validate.form()) {
                upload();
	            // $.operate.save(prefix + "/edit", $('#form-people-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
